package components.dialogs.adjustments
{
	import UIFree.uif_component;
	
	import classes.Commands.c_applyFilterCommand;
	import classes.c_util;
	
	import components.dialogs.c_elementPropDlg;
	import components.dialogs.c_filterPropDlg;
	import components.dialogs.c_propertyDialog;
	import components.editor.c_baseElement;
	
	import flash.events.Event;
	import flash.filters.ColorMatrixFilter;
	
	public class c_Saturation extends c_filterPropDlg {
		public function c_Saturation(parent:uif_component, a_element:c_baseElement, a_title:String='', modal:Boolean=false, canClose:int=2) {
			super(parent, a_element, a_title, modal, canClose);
		}
		
		override protected function propertyList(): Array {
			return [{
				title	: 'Насыщенность',
				type	: c_propertyDialog.PTYPE_NUMBER,
				value	: (filter as ColorMatrixFilter).matrix[0] * 50
			}];
		}
		
		override protected function filterClass(): Class {
			return ColorMatrixFilter;
		}
		
		override protected function doChange(e:Event):void {
			(filter as ColorMatrixFilter).matrix = c_util.SaturationArray(values[0].value / 50);
			super.doChange(e);
		}		
	}
}